import request from '@/utils/request'

// 获取月卡信息列表
export function getCarList(params) {
  return request({
    url: '/parking/card/list',
    method: 'get',
    params
  })
}

// 新增月卡
export function addCar(data) {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}

/**
 * 获取月卡详情
 * @data
 * @returns
 */
export function getCardDetail(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}

// 编辑月卡
export function updataCar(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}

/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export function delCard(id) {
  return request({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}

// 批量删除月卡
export function delCardList(idlist) {
  return request({
    url: `/parking/card/${idlist.join(',')}`,
    method: 'DELETE'
  })
}
